/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gclient;

import java.util.Vector;

/**
 *
 * @author sv
 */
public class FileInfo {

    public FileInfo(String sha1FileName, boolean fullyAvailable, Vector<Integer> availableChunks, String fPath) {
        this.sha1FileName = sha1FileName;
        this.fullyAvailable = fullyAvailable;
        this.availableChunks = availableChunks;
        this.filePath = new String (fPath);
    }
    
    public Vector<Integer> getAvailableChunks() {
        return availableChunks;
    }

    public void setAvailableChunks(Vector<Integer> availableChunks) {
        this.availableChunks = (Vector<Integer>)availableChunks.clone();
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public boolean isFullyAvailable() {
        return fullyAvailable;
    }

    public void setFullyAvailable(boolean fullyAvailable) {
        this.fullyAvailable = fullyAvailable;
    }

    public String getSha1FileName() {
        return sha1FileName;
    }

    public void setSha1FileName(String sha1FileName) {
        this.sha1FileName = sha1FileName;
    }

    public void addChunk(int chunkNumber) {
	    if ( availableChunks == null)
		    availableChunks = new Vector<Integer>();
	    availableChunks.add(chunkNumber);	    
    }


    protected String sha1FileName;
    protected boolean fullyAvailable;
    protected Vector<Integer> availableChunks;
    protected String filePath;
}
